using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pay.Data {
	public partial class ShippingMap
		: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<Shipping> {
		public ShippingMap() {
			// table
			ToTable("mc_Shipping", "dbo");

			// keys
			HasKey(t => t.OrderId);

			// Properties
			Property(t => t.OrderId)
				.HasColumnName("OrderId")
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None)
				.IsRequired();
			Property(t => t.ShipTo)
				.HasColumnName("ShipTo")
				.HasMaxLength(50)
				.IsOptional();
			Property(t => t.Phone)
				.HasColumnName("Phone")
				.HasMaxLength(20)
				.IsOptional();
			Property(t => t.RegionId)
				.HasColumnName("RegionId")
				.IsOptional();
			Property(t => t.RegionName)
				.HasColumnName("RegionName")
				.HasMaxLength(100)
				.IsOptional();
			Property(t => t.Address)
				.HasColumnName("Address")
				.HasMaxLength(100)
				.IsOptional();
			Property(t => t.ExpressNo)
				.HasColumnName("ExpressNo")
				.HasMaxLength(50)
				.IsOptional();
			Property(t => t.ExpressCompanyName)
				.HasColumnName("ExpressCompanyName")
				.HasMaxLength(100)
				.IsOptional();
			Property(t => t.ShipOrderNumber)
				.HasColumnName("ShipOrderNumber")
				.HasMaxLength(100)
				.IsOptional();
			Property(t => t.ShippingTime)
				.HasColumnName("ShippingTime")
				.IsOptional();
			Property(t => t.IdCard)
				.HasColumnName("IdCard")
				.IsOptional();

			Property(t => t.CardNegative)
				.HasColumnName("CardNegative")
				.IsOptional();

			Property(t => t.CardPositive)
				.HasColumnName("CardPositive")
				.IsOptional();

			Property(t => t.RealName)
				.HasColumnName("RealName")
				.IsOptional();

			HasRequired(t => t.Order)
				.WithOptional(t => t.Shipping)
				.WillCascadeOnDelete(false);
		}
	}
}
